package com.yxq.mdt.app.modules.spike.prestener;


import com.yxq.mdt.app.base.BasePresenter;
import com.yxq.mdt.app.modules.spike.bean.SpikeBean;
import com.yxq.mdt.app.modules.spike.bean.SpikeGoodsBean;
import com.yxq.mdt.app.modules.spike.model.SpikeModel;
import com.yxq.mdt.app.net.ApiModel;

public class SpikePresenter extends BasePresenter<ISpikeContract.View, SpikeModel> implements ISpikeContract.Presenter {

    public SpikePresenter(ISpikeContract.View view, SpikeModel model) {
        super(view, model);
    }

    @Override
    public void list() {

        mBaseModel.list(new ApiModel.CommonCallback<SpikeBean>() {
            @Override
            public void onSuccess(SpikeBean beanList) {
                mRootView.onLoadListSuccess(beanList);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadListFailed(errMsg);
            }
        });
    }

    @Override
    public void goodsList(String time, int page) {
        mBaseModel.goodsList(time, page, new ApiModel.CommonCallback<SpikeGoodsBean>() {
            @Override
            public void onSuccess(SpikeGoodsBean spikeGoodsBean) {
                mRootView.onLoadGoodsListSuccess(spikeGoodsBean);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadGoodsListFailed(errMsg);
            }
        });
    }
}
